Context Menu for add and remove datalist column [migrated]

Posted by Kadir Ozgur on Programmers See other posts from Programmers or by Kadir Ozgur
Published on 2012-10-02T11:46:39Z Indexed on 2012/10/02 15:52 UTC
Read the original article Hit count: 198

Filed under:

When I right click on Datalist Columns then a context menu appears whose items are add columns, remove column etc. When I removed a column and if I want to remove one more column then it shows me to remove previous column. Everytime, it shows me to remove the previous ones.

       if (mnu.Name.StartsWith("Rem"))
    {
        //getview();
        //datalist.Items.Refresh();
        //rows.Clear();
        //datalist.ItemsSource = rows;
        int id = listwork.dispidx(util.valint(/*mnu.Name.Substring(3)*/util.valint(mnu.Tag)), ListWork.eArtIdx.dispord);
        int delid = listwork.delcol(id);
        GridViewColumnCollection gw = getview().Columns;
        if (delid >= 0 &&  delid  < gw.Count) gw.RemoveAt(delid);
        listsortnr = 0;  //weil wir ja Colonnen gelöschte haben
        showsortlist(listwork.querydef.Sortcol);
        //rows.Clear();
        DoRefresh();



    }

© Programmers or respective owner

Related posts about c#